package com.permissions.dispatcher.processor.exception;

import com.permissions.dispatcher.processor.util.Extensions;

import javax.lang.model.element.ExecutableElement;
import javax.lang.model.type.TypeMirror;

/**
 * 错误参数异常
 */
public class WrongParametersException extends RuntimeException {
    /**
     * 错误参数异常
     */
    public WrongParametersException(ExecutableElement executableElement, int numParams, TypeMirror requiredType) {
        super(
                "Method '"
                        + Extensions.simpleString(executableElement)
                        + "()' must has less than or equal to "
                        + numParams
                        + " size parameter and type of it is supposed to be '"
                        + Extensions.simpleString(requiredType)
                        + "'");
    }
}
